#include "DoubleLinkedQueue.h"

void test1() {
    DoubleLinkedQueue* queue = init_queue();
    enqueue_front(queue, 1);
    enqueue_front(queue, 2);
    enqueue_front(queue, 3);
    enqueue_rear(queue, 4);
    enqueue_rear(queue, 5);
    enqueue_rear(queue, 6);
    dequeue_rear(queue);
    dequeue_front(queue);
    dequque_all_front(queue);
    clear_queue(queue);
    queue = NULL;
}

void test2() {
    DoubleLinkedQueue* queue = init_queue();
    enqueue_front(queue, 1);
    enqueue_front(queue, 2);
    enqueue_front(queue, 3);
    enqueue_rear(queue, 4);
    enqueue_rear(queue, 5);
    enqueue_rear(queue, 6);
    printf("front: %d\n", front(queue));
    printf("rear: %d\n", rear(queue));
    dequque_all_rear(queue);
    clear_queue(queue);
    queue = NULL;
}

int main() {
    void (*test[])() = {test1, test2};
    int len = sizeof(test) / sizeof(*test);
    for (int i = 0; i < len; ++i) {
        test[i]();
    }
}